PL/SQL profiler utility


Use this utility to view and analyze server-side PL/SQL profile data collected.
Steps to collect PL/SQL profile data are as below:

  declare runid binary_integer;
  j binary_integer;
  begin
    j := DBMS_PROFILER.start_profiler(sysdate, 'Some comments', runid);
    DBMS_OUTPUT.PUT_LINE(runid);
    foo;           //Stored procedure you want to profile.
    DBMS_PROFILER.STOP_PROFILER;
    DBMS_PROFILER.rollup_run(runid);
  end;
Once the data is collected use the viewer to display the collected data. You can see the profile data collected at the collection level or at program units level by selecting the 'View By Program Units' tab or at line level by selecting on the 'View By Line Numbers' tab. Further, by double-clicking or clicking the button on the left hand side on a program unit you can see the detailed profile information and the source for that program unit. Sort the profile data on any column by clicking the item at the top of that column. You can delete, export or print the profile data of a run using the menu items or tool-bar at the top.

Package Name

profview.jar

Assumptions:

  1. The Profiler tables PLSQL_PROFILER_RUNS, PLSQL_PROFILER_UNITS and PLSQL_PROFILER_DATA are assumed to be in the user's schema or corresponding public synonyms exists for them. Also, user has select, delete, update permissions on them.
  2. You MUST have JDK117b or later installed, correctly. Your path must include the directory that contains the Java binaries.
  3. You have Oracle Client 8.1.6 or later installed.
  4. The Oracle-supplied Java package EWT 3.3.3 and its dependent packages are installed. These are provided as part of the normal Oracle Client installation.
  5. OCI8 Oracle JDBC driver installed.

Sample scripts:

Sample scripts for installing and runing the viewer are provided, for NT and Unix, in %ORACLE_HOME%\plsql\demo\profview_nt.bat and $ORACLE_HOME/plsql/demo/profview_unix.csh, respectively. These automate the detailed process given below, which should only be used if the sample scripts are unsuitable.

Detailed Extraction instructions :

1. create "oracle\de" directory on your machine. For ex:

c:\oracle\de

2. Use winzip to extract the files
OR
Go to the directory you want to store the profiler files
use the following command on the (in a shell in case of NT) prompt:

jar xf profiler.jar

Environment:


set your class path

Your class path should include the parent of the "oracle" directory you have created, as well as the Sun-originated swing classes, and the Oracle-supplied EWT and JDBC classes. These files will be found in the ORACLE_HOME/jlib and ORACLE_HOME/jdbc/lib directories. The EWT file names will be of the form "ewt_version.jar", and "share_version.jar" . The Oracle JDBC file names will be "classes111.zip". The Swing file name will generally be "swingall.jar".

Ex:
classpath=c:\;c:\orant\jdbc\lib\classes111.zip;c:\orant\jlib\ewt_3_3_3.jar;c:\orant\jlib\share_1_0_8.jar;%Swing_home%\swingall.jar;%ClassPath%

Usage:


On the command prompt (in a shell in case of NT) go to the profiler directory, i.e., c:\oracle\de

Command to start profiler:

java riw

Known problems:

  1. "View By Line" sometimes can show duplicate rows.
  2. Sorting by clicking on the spread table headers will not get painted properly. Work around: Resize the header to force repainting of the spread table.